1. Field of the Invention
The present invention relates to an image processing apparatus and method which detect a specific image area in which a noticeable deterioration in image quality is caused by subsampling or the like, selecting an encoding scheme most suitable for the detected area, and encoding the area.
2. Description of the Related Art
Encoding techniques which are used to compress the amount of image data are roughly classified into two types, that is, a lossless encoding technique with little loss of information due to compression/decompression and a lossy encoding technique with a deterioration in image quality due to compression/decompression. In general, lossy encoding provides a higher compression ratio than lossless encoding, and allows adjusting the amount of code generated by changing the degree of deterioration in image quality.
Conventionally, there has been available a method comprising lossless and lossy encoding schemes as encoding schemes of compressing data to a given target amount of code, which uses the lossless encoding scheme when the target amount of code can be achieved by lossless encoding, and uses the lossy encoding scheme when the target amount of code cannot be achieved. For example, there is known a method of applying lossless encoding or lossy encoding to encoding target data after reducing its amount by, for example, decreasing the resolution to ½ when checking the compression ratio achieved by lossless encoding for each predetermined unit of encoding and determining that the target amount of code will be exceeded (for example, Japanese Patent Laid-Open No. 10-207645).
When an image is segmented into a plurality of blocks and the conventional technique is applied to each block, it is possible to control the amount og code generated for each fine unit. On the other hand, when a losslessly encoded block is adjacent to a lossily encoded block, the boundary looks unnatural and becomes noticeable.